#!/bin/bash
MAJOR_VERSION=8
MINOR_VERSION=0
PATCH_VERSION=25
RELEASE=15
REVISION=`date +%Y%m%d%H%M`
BASE_DIR=/usr/local/GreatSQL-8.0.25
JOBS=16
#reversion=`echo $RANDOM | sha256sum | cut -c1-11` && echo $reversion; 
cmake . -DBOOST_INCLUDE_DIR=../boost_1_73_0 -DCMAKE_INSTALL_PREFIX=${BASE_DIR} -DWITH_ZLIB=bundled \
-DWITH_NUMA=ON -DFORCE_INSOURCE_BUILD=1 -DCMAKE_EXE_LINKER_FLAGS="-ljemalloc" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release \
-DCOMPILATION_COMMENT="GreatSQL (GPL), Release ${RELEASE}, Revision ${REVISION}" \
-DWITH_TOKUDB=OFF -DWITH_ROCKSDB=OFF \
-DMAJOR_VERSION=${MAJOR_VERSION} -DMINOR_VERSION=${MINOR_VERSION} -DPATCH_VERSION=${PATCH_VERSION} && \
make -j${JOBS} VERBOSE=1 && make install
